package com.huike.web.controller.contract;

import com.huike.clues.domain.ClueTransfer;
import com.huike.clues.domain.TbClue;
import com.huike.clues.service.ITbClueService;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.domain.entity.SysUser;
import com.huike.common.core.page.TableDataInfo;
import com.huike.contract.domain.vo.TransferVo;
import com.huike.contract.service.ITransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/transfer")
public class TransferController extends BaseController {

    @Autowired
    ITransferService iTransferService;

    @GetMapping("/list")
    public TableDataInfo transferlist(SysUser user) {
        List<TransferVo> list = iTransferService.selectTransferList(user);
        return getDataTablePage(list);
    }

    @PutMapping("/assignment/{type}/{userId}/{transferUserId}")
    public AjaxResult assignment(@PathVariable String type,@PathVariable Long userId,@PathVariable Long transferUserId ){

        iTransferService.transferByUserId(type,userId,transferUserId);

        return  AjaxResult.success();
    }
}